import {Component, OnInit, ViewChild} from '@angular/core'

@Component({
  selector: 'app-parent',
  templateUrl: './parent.component.html',
  styleUrls: ['./parent.component.scss']
})
export class ParentComponent implements OnInit {
  public msg: string = '我是Parent组件的msg数据'
  @ViewChild('footer') footer: any

  constructor() {
  }

  ngOnInit(): void {
  }

  run() {
    alert('==parent run===')
  }

  getChid() {
    console.log(this.footer.childMsg)
    this.footer.childRun()
  }

  receiveChild(e){
    console.log(e)
  }
}
